//
//  PCDApiCheckFinger.m
//  PCDBankSix
//
//  Created by DK on 2022/3/5.
//

#import "PCDApiCheckFinger.h"
#import "PCDFaceIDModel.h"

@implementation PCDApiCheckFinger

- (void)handler:(id)data andContext:(PCDContext *)context ResponseCallback:(WVJBResponseCallback )responseCallback
{
    NSDictionary *dict = (NSDictionary *)data;
    NSString *func = [dict objectForKey:@"success"];
    self.bsContext = context;
    
    __weak typeof(self) tempSelf = self;
    [[PCDFaceIDModel shareFaceIDInstance] startFaceID:^(BOOL flag, id  _Nonnull loginInfo) {

        NSString *status = [NSString stringWithFormat:@"{\"status\":%d}",flag];
        
        dispatch_async(dispatch_get_main_queue(), ^{
            
            evaluateJavaScriptOnMainThread(self,func,status);
        });
    }];
}

@end
